using UnityEngine;

public class DisplayMetricsAndroid : GGScreenMetrics
{
	private float xdpi = 80f;

	private float ydpi = 80f;

	public override float XDPI
	{
		get
		{
			return xdpi;
		}
	}

	public override float YDPI
	{
		get
		{
			return ydpi;
		}
	}

	public DisplayMetricsAndroid()
	{
		if (Application.platform != RuntimePlatform.Android)
		{
			return;
		}
		try
		{
			using (AndroidJavaClass androidJavaClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
			{
				using (new AndroidJavaClass("android.util.DisplayMetrics"))
				{
					using (AndroidJavaObject androidJavaObject4 = new AndroidJavaObject("android.util.DisplayMetrics"))
					{
						using (AndroidJavaObject androidJavaObject = androidJavaClass.GetStatic<AndroidJavaObject>("currentActivity"))
						{
							using (AndroidJavaObject androidJavaObject2 = androidJavaObject.Call<AndroidJavaObject>("getWindowManager", new object[0]))
							{
								using (AndroidJavaObject androidJavaObject3 = androidJavaObject2.Call<AndroidJavaObject>("getDefaultDisplay", new object[0]))
								{
									androidJavaObject3.Call("getMetrics", androidJavaObject4);
									xdpi = androidJavaObject4.Get<float>("xdpi");
									ydpi = androidJavaObject4.Get<float>("ydpi");
								}
							}
						}
					}
				}
			}
		}
		catch
		{
		}
	}
}
